<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Dnd - Dojo Adapter (From dojo)</title>
	
		<link rel="stylesheet" type="text/css" href="../../../../dojo/resources/dojo.css" />
		<link rel="stylesheet" type="text/css" href="../../../../dojo/tests/dnd/dndDefault.css" />
		<link rel="stylesheet" type="text/css" href="../../../../dijit/themes/tundra/tundra.css" />
		<link rel="stylesheet" type="text/css" href="../../../../dijit/tests/css/dijitTests.css" />
		
		<link rel="stylesheet" type="text/css" href="../../resources/dnd.css" />
		<link rel="stylesheet" type="text/css" href="../resources/test_dnd.css" />
		
		<script type="text/javascript" src="../../../../dojo/dojo.js"
			djConfig="parseOnLoad:true, isDebug:true"></script>

		<script type="text/javascript">
			dojo.require("dojox.mdnd.AreaManager");
			dojo.require("dojox.mdnd.DropIndicator");
			dojo.require("dojox.mdnd.dropMode.VerticalDropMode");
			dojo.require("dojox.mdnd.AutoScroll");
			dojo.require("dojox.mdnd.PureSource");
			dojo.require("dojo.dnd.Source");
			dojo.require("dojox.mdnd.adapter.DndFromDojo");
			dojo.require("dijit._base.sniff");
			var init = function(){
				var m = dojox.mdnd.areaManager();
				m.areaClass = "dndArea";
				m.dragHandleClass = "dragHandle";
				m.init();

				dojo.subscribe("/dnd/drop/after","createNode");					
			};
			
			dojo.addOnLoad(init);
			
			function createNode(source, nodes, copy, target, dropIndex){
				var node = dojo.byId("item").cloneNode(true);
				if(target){
					dojox.mdnd.areaManager().addDragItem(target, node, dropIndex);
				}
			}
		</script>
	</head>
	<body class="tundra">
		<h1>Drag and Drop : dojo Dnd to Dojox Dnd</h1>
		<div style="position:absolute;width:200px;left:350px;top:50px;">
			<H2>Pure Source</H2>
			<div id="dojoPureSource" dojoType="dojox.mdnd.PureSource" class="container">
				<div class="dojoDndItem" dndType="type1">item Type1</div>
				<div class="dojoDndItem" dndType="type2">item Type2</div>
			</div>
		</div>
		<div style="position:absolute;width:200px;left:350px;top:200px;">
			<H2>Source/Target Dojo</H2>
			<p>Accepts Type1 & Type2 dojo's items</p>
			<div id="dojoSource" dojoType="dojo.dnd.Source" accept="type1, type2, text" class="container">
				<div class="dojoDndItem" dndType="type1">item Type1</div>
				<div class="dojoDndItem" dndType="type2">item Type2</div>
			</div>
		</div>
		<div style="position:absolute;width:200px;left:50 px;top:50px;">
			<H2>Source/Target dojox </H2>
			<p>Accepts only Type1 items</p>
			<div class="dndArea container" accept="type1, text">
				<div id="item" class="dndItem">
					<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
				</div>
			</div>
		</div>
	</body>
</html>
